package com.example.project7.viewmodel;

import com.example.project7.model.User;

import java.util.List;

public abstract class UserState {
    private UserState() {}

    public static class Loading extends UserState {
        @Override
        public String toString() {
            return "UserState.Loading";
        }
    }

    public static class Success extends UserState {
        private List<User> users;

        public Success(List<User> users) {
            this.users = users;
        }

        public List<User> getUsers() {
            return users;
        }

        @Override
        public String toString() {
            return "UserState.Success";
        }
    }

    public static class Error extends UserState {
        private String errorMessage;

        public Error(String errorMessage) {
            this.errorMessage = errorMessage;
        }

        public String getErrorMessage() {
            return errorMessage;
        }

        @Override
        public String toString() {
            return "UserState.Error: " + errorMessage;
        }
    }

    public static class Empty extends UserState {
        @Override
        public String toString() {
            return "UserState.Empty";
        }
    }
}